package learn.timer;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

public class TestTimer {


    public static void main(String[] args) {
        Timer timer = new Timer();

        TimerTask timerTask = new TimerTask() {
            @Override
            public void run() {
                System.out.println("hello world");
            }
        };

//        timer.schedule(timerTask,10000);

//        timer.schedule(timerTask,3000,1000);

        timer.schedule(timerTask,new Date(),1000);

    }

}
